﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;

namespace BLL
{
    public class BLLChiTietDonHang
    {
        private string idchitiet;
        public string Idchitiet
        {
            get { return idchitiet; }
            set { idchitiet = value; }
        }

        private string idsanpham;
        public string Idsanpham
        {
            get { return idsanpham; }
            set { idsanpham = value; }
        }

        private string iddonhang;
        public string Iddonhang
        {
            get { return iddonhang; }
            set { iddonhang = value; }
        }

        private int soluong;
        public int Soluong
        {
            get { return soluong; }
            set { soluong = value; }
        }

        private decimal dongia;
        public decimal Dongia
        {
            get { return dongia; }
            set { dongia = value; }
        }

        private decimal thanhtien;
        public decimal Thanhtien
        {
            get { return thanhtien; }
            set { thanhtien = value; }
        }

        private BLLSanPham sanpham;
        public BLLSanPham SanPham
        {
            get { return sanpham; }
            set { sanpham = value; }
        }
        private string tensp;
        public string Tensp
        {
            get { return tensp; }
            set { tensp = value; }
        }
        private string mausac;
        public string Mausac
        {
            get { return mausac; }
            set { mausac = value; }
        }
        private string kichco;
        public string Kichco
        {
            get { return kichco; }
            set { kichco = value; }
        }
        //private List<BLLDonHang> donhang;
        //public List<BLLDonHang> DonHang
        //{
        //    get { return donhang; }
        //    set { donhang = value; }
        //}
        //khoi tao
        public BLLChiTietDonHang()
        { }
        public BLLChiTietDonHang(string _iddh)
        {
            Iddonhang = _iddh;
        }
        public BLLChiTietDonHang(string _iddh, string _idsp)
        {
            Iddonhang = _iddh;
            Idsanpham = _idsp;
        }
        public BLLChiTietDonHang(string _idct, string _idsp, string _isdh,int _sl,decimal _dg, decimal _tt)
        {
            Idchitiet = _idct;
            Idsanpham = _idsp;
            Iddonhang = _isdh;
            Dongia = _dg;
            Soluong = _sl;
            Thanhtien = _tt;
        }
        public BLLChiTietDonHang(string _idct, string _idsp, string _isdh, int _sl, decimal _dg, decimal _tt, string _tensp, string _kichco, string _mausac)
        {
            Idchitiet = _idct;
            Idsanpham = _idsp;
            Iddonhang = _isdh;
            Dongia = _dg;
            Soluong = _sl;
            Thanhtien = _tt;
            Tensp = _tensp;
            Mausac = _mausac;
            Kichco = _kichco;
        }
         //them moi'
        public string Add
        {
            get { return DALChiTietDonHang.Add(this); }
        }
        //lay chi tiet=id
        public List<BLLChiTietDonHang> GetbyId()
        {
            return DALChiTietDonHang.GetById(this);
        }
        public string DeletebySanpham()
        {
            return DALChiTietDonHang.DeletebySanpham(this);
        }
        public string DeletebyDonhang()
        {
            return DALChiTietDonHang.DeletebyDonhang(this);
        }
    }
}
